<?php 

	include_once "CFclass/CF_support.php";

//define field dropdowns and lookups for listpage only
if(($PAGETYPE == 'LIST') OR ($PAGETYPE == 'FORM') ){
//$array_crudset_id_list = get_array_query("SELECT crudset_id AS keyvalue, cs_name AS showvalue FROM crudsets WHERE project_id = " .GetPagePersistent('flt_project_id') );
$array_variable_id_list = get_array_query("SELECT variables.variable_id AS keyvalue, variable_name AS showvalue FROM variables 
JOIN crudsets ON crudsets.main_table = variables.source_id OR variables.source_id = 0 WHERE 1 " . " AND crudset_id = " . GetPagePersistent('flt_crudset_id'));
}


//column settings for crudcol_id
$fieldspec['crudcol_id'] ['show'] = 1;
$fieldspec['crudcol_id'] ['key'] = 1;
$fieldspec['crudcol_id'] ['size'] = 20;
$fieldspec['crudcol_id'] ['rows'] = 1;

//column settings for crudset_id
$fieldspec['crudset_id'] ['show'] = 'L';
$fieldspec['crudset_id'] ['select'] = 'D';
$array_crudset_id_list = get_array_query("SELECT crudset_id AS keyvalue, cs_name AS showvalue FROM crudsets ");
$fieldspec['crudset_id'] ['list'] = $array_crudset_id_list;
$fieldspec['crudset_id'] ['filter'] = 1;
$fieldspec['crudset_id'] ['size'] = 20;
$fieldspec['crudset_id'] ['rows'] = 1;
$fieldspec['crudset_id'] ['add'] = 1;

//column settings for variable_id
$fieldspec['variable_id'] ['show'] = 'L';
$fieldspec['variable_id'] ['select'] = 'D';

$fieldspec['variable_id'] ['list'] = $array_variable_id_list;
$fieldspec['variable_id'] ['size'] = 20;
$fieldspec['variable_id'] ['rows'] = 1;
$fieldspec['variable_id'] ['add'] = 1;

//column settings for is_key
$fieldspec['is_key'] ['show'] = 'E';
$fieldspec['is_key'] ['select'] = 'C';
$fieldspec['is_key'] ['size'] = 20;
$fieldspec['is_key'] ['rows'] = 1;

//column settings for shown_in_list
$fieldspec['shown_in_list'] ['show'] = 'E';
$fieldspec['shown_in_list'] ['select'] = 'C';
$fieldspec['shown_in_list'] ['size'] = 20;
$fieldspec['shown_in_list'] ['rows'] = 1;

//column settings for edit_in_list
$fieldspec['edit_in_list'] ['show'] = 'E';
$fieldspec['edit_in_list'] ['select'] = 'C';
$fieldspec['edit_in_list'] ['size'] = 20;
$fieldspec['edit_in_list'] ['rows'] = 1;

//column settings for edit_type
$fieldspec['edit_type'] ['show'] = 'E';
$array_edit_type_list [1] ['keyvalue'] = 'text';
$array_edit_type_list [1] ['showvalue'] = 'text';
$array_edit_type_list [2] ['keyvalue'] = 'textarea';
$array_edit_type_list [2] ['showvalue'] = 'textarea';
$array_edit_type_list [3] ['keyvalue'] = 'commalist';
$array_edit_type_list [3] ['showvalue'] = 'commalist';
$array_edit_type_list [4] ['keyvalue'] = 'querylist';
$array_edit_type_list [4] ['showvalue'] = 'querylist';
$array_edit_type_list [5] ['keyvalue'] = 'checkbox';
$array_edit_type_list [5] ['showvalue'] = 'checkbox';
$array_edit_type_list [6] ['keyvalue'] = 'calendar';
$array_edit_type_list [6] ['showvalue'] = 'calendar';
$array_edit_type_list [7] ['keyvalue'] = 'calicon';
$array_edit_type_list [7] ['showvalue'] = 'cal-icon';
$array_edit_type_list [8] ['keyvalue'] = 'multical';
$array_edit_type_list [8] ['showvalue'] = 'cal-multical';
$fieldspec['edit_type'] ['list'] = $array_edit_type_list;
$fieldspec['edit_type'] ['select'] = 'D';
$fieldspec['edit_type'] ['size'] = 20;
$fieldspec['edit_type'] ['rows'] = 1;

//column settings for filter
$fieldspec['filter'] ['show'] = 'E';
$fieldspec['filter'] ['select'] = 'A';
$fieldspec['filter'] ['size'] = 20;
$fieldspec['filter'] ['rows'] = 2;

//column settings for filter
$fieldspec['showfilter'] ['show'] = 'E';
$fieldspec['showfilter'] ['select'] = 'C';
$fieldspec['showfilter'] ['size'] = 20;
$fieldspec['showfilter'] ['rows'] = 1;


//column settings for is_sort
$fieldspec['is_sort'] ['show'] = 'E';
$fieldspec['is_sort'] ['select'] = 'C';
$fieldspec['is_sort'] ['size'] = 20;
$fieldspec['is_sort'] ['rows'] = 1;

//column settings for header_name
$fieldspec['header_name'] ['show'] = 'E';
$fieldspec['header_name'] ['select'] = 'T';
$fieldspec['header_name'] ['size'] = 20;
$fieldspec['header_name'] ['rows'] = 1;

//column settings for is_add
$fieldspec['is_add'] ['show'] = 'E';
$fieldspec['is_add'] ['select'] = 'C';
$fieldspec['is_add'] ['size'] = 20;
$fieldspec['is_add'] ['rows'] = 1;

//column settings for list_query
$fieldspec['list_query'] ['show'] = 'E';
$fieldspec['list_query'] ['select'] = 'T';
$fieldspec['list_query'] ['size'] = 20;
$fieldspec['list_query'] ['rows'] = 1;

//column settings for list_keycol
$fieldspec['list_keycol'] ['show'] = 'E';
$fieldspec['list_keycol'] ['select'] = 'T';
$fieldspec['list_keycol'] ['size'] = 20;
$fieldspec['list_keycol'] ['rows'] = 1;

//column settings for list_showcol
$fieldspec['list_showcol'] ['show'] = 'E';
$fieldspec['list_showcol'] ['select'] = 'T';
$fieldspec['list_showcol'] ['size'] = 20;
$fieldspec['list_showcol'] ['rows'] = 1;

//column settings for size
$fieldspec['size'] ['show'] = 'E';
$fieldspec['size'] ['select'] = 'T';
$fieldspec['size'] ['size'] = 4;
$fieldspec['size'] ['rows'] = 1;

//column settings for rows
$fieldspec['rows'] ['show'] = 'E';
$fieldspec['rows'] ['select'] = 'T';
$fieldspec['rows'] ['size'] = 4;
$fieldspec['rows'] ['rows'] = 1;

//column settings for col_order
$fieldspec['col_order'] ['show'] = 'E';
$fieldspec['col_order'] ['select'] = 'T';
$fieldspec['col_order'] ['size'] = 2;
$fieldspec['col_order'] ['rows'] = 1;

//column settings for makefunction
$fieldspec['makefunction'] ['show'] = 'E';
$fieldspec['makefunction'] ['select'] = 'T';
$fieldspec['makefunction'] ['size'] = 8;
$fieldspec['makefunction'] ['rows'] = 1;

?>